#pragma once
//#include <string>
#include "..\dxstdafx.h"
#include "Asset.h"
#include "..\base\Engine.h"
#include "..\utils\Logger.h"

namespace ds {

struct CharDef {
	uint32 ascii;
	int startX;
	int startY;
	int width;
};
	
class BitmapFont : public Asset {

typedef List<CharDef> CharDefinitions;

public:		
	BitmapFont(const char* handle,uint32 startChar,uint32 charHeight,uint32 startX,uint32 startY,uint32 textureSize);
	virtual ~BitmapFont();	
	void addChar(uint32 ascii,int startX,int startY,int width);
	Rect getTextureRect(uint32 ascii);
	CharDef& getCharDef(char c) {
		return m_CharDefinitions[(int)c-m_StartChar];
	}
	float getCharHeight();
	uint32 getTextureSize() {
		return m_TextureSize;
	}
private:
	uint32 m_StartChar;
	uint32 m_TextureSize;
	uint32 m_CharHeight;
	uint32 m_StartX;
	uint32 m_StartY;	
	CharDefinitions m_CharDefinitions;
};

}
